package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.GoodsNumLogMapper;
import com.ruoyi.shop.domain.GoodsNumLog;
import com.ruoyi.shop.service.IGoodsNumLogService;

/**
 * 库存日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-28
 */
@Service
public class GoodsNumLogServiceImpl implements IGoodsNumLogService 
{
    @Autowired
    private GoodsNumLogMapper goodsNumLogMapper;

    /**
     * 查询库存日志
     * 
     * @param id 库存日志主键
     * @return 库存日志
     */
    @Override
    public GoodsNumLog selectGoodsNumLogById(Long id)
    {
        return goodsNumLogMapper.selectGoodsNumLogById(id);
    }

    /**
     * 查询库存日志列表
     * 
     * @param goodsNumLog 库存日志
     * @return 库存日志
     */
    @Override
    public List<GoodsNumLog> selectGoodsNumLogList(GoodsNumLog goodsNumLog)
    {
        return goodsNumLogMapper.selectGoodsNumLogList(goodsNumLog);
    }

    /**
     * 新增库存日志
     * 
     * @param goodsNumLog 库存日志
     * @return 结果
     */
    @Override
    public int insertGoodsNumLog(GoodsNumLog goodsNumLog)
    {
        goodsNumLog.setCreateTime(DateUtils.getNowDate());
        return goodsNumLogMapper.insertGoodsNumLog(goodsNumLog);
    }

    /**
     * 修改库存日志
     * 
     * @param goodsNumLog 库存日志
     * @return 结果
     */
    @Override
    public int updateGoodsNumLog(GoodsNumLog goodsNumLog)
    {
        goodsNumLog.setUpdateTime(DateUtils.getNowDate());
        return goodsNumLogMapper.updateGoodsNumLog(goodsNumLog);
    }

    /**
     * 批量删除库存日志
     * 
     * @param ids 需要删除的库存日志主键
     * @return 结果
     */
    @Override
    public int deleteGoodsNumLogByIds(Long[] ids)
    {
        return goodsNumLogMapper.deleteGoodsNumLogByIds(ids);
    }

    /**
     * 删除库存日志信息
     * 
     * @param id 库存日志主键
     * @return 结果
     */
    @Override
    public int deleteGoodsNumLogById(Long id)
    {
        return goodsNumLogMapper.deleteGoodsNumLogById(id);
    }
}
